import request from "@/utils/request.js";


/**
 * 新增-编辑推荐人
 * @param {Object} data 
 * @returns 
 */
export const addExtensionStaff = (data) => {
    return request({
        url: '/jy-member/member/referrer/saveOrUpdateReferrer',
        method: 'post',
        data
    })
}



/**
 * 下载二维码
 * @param {Object} data 
 * @returns 
 */
export const downloadQRCode = (data) => {
    return request({
        url: '/jy-member/member/referrer/qrCodeDownload',
        method: 'post',
        data
    })
}



/**
 * 删除推荐人
 * @param {String} referrerId 
 * @returns 
 */
export const removeReferences = (referrerId) => {
    return request({
        url: `jy-member/member/referrer/${referrerId}`,
        method: 'delete',
    })
}



/**
 * 推广管理列表
 * @param {Object} data 
 * @returns 
 */
export const extensionManagementList = (data) => {
    return request({
        url: '/jy-member/member/referrer/page',
        method: 'post',
        data
    })
}

/**
 * 推广管理列表mgmt
 * @param {Object} data 
 * @returns 
 */
export const extensionManagementListmgmt = (data) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/page',
        method: 'post',
        data
    })
}

/**
 * 个人详情
 * @param {Object} data 
 * @returns 
 */
export const personalParticulars = (params) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/referrerInfo',
        method: 'get',
        params
    })
}

/**
 * 个人详情
 * @param {Object} data 
 * @returns 
 */
export const switchState = (params) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/optReferrerStatus',
        method: 'get',
        params
    })
}

/**
 * 推荐人状态编辑
 * @param {Object} data 
 * @returns 
 */
export const referrerStatusEdit = (params) => {
    return request({
        url: '/jy-member/member/referrer/optReferrerStatus',
        method: 'get',
        params
    })
}


/**
 * 推广人员管理详情
 * @param {Object} data 
 * @returns 
 */
export const PromoterDetail = (data) => {
    return request({
        url: '/jy-member/member/referrer/details',
        method: 'post',
        data
    })
}


/**
 * 推广列表
 * @param {Object} data 
 * @returns 
 */
export const PromotersList = (data) => {
    return request({
        url: '/jy-member/member/referrer/details',
        method: 'post',
        data
    })
}

/**
 * 推广订单-个人推广列表
 * @param {Object} data 
 * @returns 
 */
export const promotionOrder = (data) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/referrerOrderPage',
        method: 'post',
        data
    })
}

/**
 * 管理平台-提现记录列表
 * @param {Object} data 
 * @returns 
 */
export const managementPlatform = (data) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/withdrawalRecord',
        method: 'post',
        data
    })
}
/**
 * 个人推广-商品列表
 * @param {Object} data 
 * @returns 
 */
export const referrerProduct = (data) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/product',
        method: 'post',
        data
    })
}
/**
 * 个人推广-设置比例
 * @param {Object} data 
 * @returns 
 */
export const referrerUpdRate = (data) => {
    return request({
        url: '/jy-member/mgmt/member/referrer/updRate  ',
        method: 'post',
        data
    })
}
